home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Communications / Converse / Source / Communication.m < prev    next >
Text File  |  1995-12-28  |  1KB  |  70 lines

  1. //** Craig Laurent
  2. #import "Communication.h"
  3. #import "MessageProtocol.h"
  4. #import "Converse.h"
  5. #import "User.h"
  6. //** SERVERNAME used in Communication and Converse
  7. #define SERVERNAME "ConverseCommunicationServer"
  8.  
  9. @implementation Communication
  10.  
  11. //** Communications SERVER!! *****
  12.  
  13.  
  14. //****************************************
  15. - init
  16. {
  17.     return [self initWithCtlr:nil];
  18. }
  19.  
  20. //** designated initializer
  21. - initWithCtlr:ctlr
  22. {
  23.     if (self = [super init]) {
  24.         [self setController:ctlr];
  25.         return self;
  26.     }
  27.     return nil;
  28. }
  29.  
  30. - (void)dealloc
  31. {
  32.     [super dealloc];
  33. }
  34.  
  35.  
  36. //****************************************
  37. //** instance methods
  38. - (Converse*)controller
  39. {    return controller; }
  40. - (void)setController:(Converse*)ctlr
  41. {
  42.     controller = ctlr;
  43. }
  44.  
  45.  
  46. //****************************************
  47. //** methods
  48. /* postMessage: - post message to another machine, indicating who sent it. */
  49. - (oneway void)postMessage:(bycopy in const char *)msg fromAuthor:(bycopy in User*)author
  50. {
  51.     [[self controller] logMessage:[NSString stringWithCString:msg] fromAuthor:author alert:YES];
  52. }
  53.  
  54. /* author - pass the user information to a requesting machine. */
  55. - (bycopy User*)author
  56. {
  57.     return [[self controller] userInfo];
  58. }
  59.  
  60.  
  61. //** create list of machines running this application on the network
  62. - createNetworkNameList:nameList forMachine:(const char *)originator
  63. {
  64. //** future enhancement
  65.     return self;
  66. }
  67.  
  68.  
  69. @end
  70.